home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD001b.dsk
/
KAFMF.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
12KB
|
390 lines
5 REM KAFMF (KEYED ACCESS FILE MAINT)
9 TH = 1000:W = 1:Z = 0
10 D$ = CHR$(4)
12 GOTO 7000
15 ONERR GOTO 9000
20 PRINT D$"OPEN "NF$",L"RL
30 PRINT D$"READ "NF$",R0"
50 INPUT H1: INPUT L1: INPUT CD$: INPUT BD$: INPUT FT$
51 H1 = H1 -1000
52 L1 = L1 -1000
55 POKE 216,0
105 PRINT D$
106 HOME
110 PRINT "FILE MAINTENANCE ON ";: INVERSE : PRINT NF$: NORMAL : GOSUB 9400: INVERSE : PRINT NZ$(W);: NORMAL : PRINT " IS ";
112 IF TZ$(W) = "C" GOTO 116
114 PRINT "NUMERIC": PRINT "MIN = ";LZ(1);", MAX = ";VZ(1): GOSUB 9400: GOTO 130
116 PRINT "CHARACTER, MAX LENGTH ";LZ(1): GOSUB 9400
130 INVERSE : PRINT NF$;: NORMAL : PRINT " IS A ";
132 IF FT$ = "S" THEN PRINT "SEQUENTIAL";
134 IF FT$ < >"S" THEN PRINT "KEYED";
136 PRINT " FILE": GOSUB 9400
138 IF FT$ < >"S" GOTO 150
139 IF R$ = "S" GOTO 150
140 PRINT "DO YOU WANT TO PUT A NEW RECORD ON IT";
142 INPUT R$
144 IF R$ = "Y" GOTO 170
146 IF R$ = "N" GOTO 149
148 GOTO 140
149 GOSUB 9400: PRINT "THEN YOU MUST WANT TO SEARCH FOR AN": PRINT TAB( 20);"EXISTING RECORD.": GOSUB 9400
150 PRINT NZ$(W);
151 IF TZ$(W) = "C" GOTO 159
152 INPUT A: IF A < > INT(A) GOTO 795
153 IF A < = 0 GOTO 790
154 IF A <LZ(1) GOTO 790
155 IF A >VZ(1) GOTO 785
156 A$ = STR$(A):B$ = STR$(VZ(1))
157 IF LEN(A$) > = LEN(B$) GOTO 200
158 A$ = "0" +A$: GOTO 157
159 INPUT A$: IF A$ < = "0" GOTO 780
160 IF A$ > = "^" GOTO 780
161 IF LEN(A$) >LZ(1) GOTO 775
162 GOTO 200
170 AS$ = "Y"
200 PRINT D$"READ "NF$",R"H1
201 INPUT B:R = B -TH
202 PRINT D$"READ "NF$",R"R
203 INPUT B:B = B -TH: INPUT F:F = F -TH: INPUT A1$: IF AS$ = "Y" THEN GOSUB 350
204 IF A1$ <A$ GOTO 400
205 UM = INT((L1 ^.5) -(L1 ^.25)) +W:NR = Z:L = W:LA$ = "0": PRINT D$: HOME : PRINT "*** BE PATIENT ***"
206 PRINT "FILE HAS ";L1 -2;" RECORDS"
210 NR = NR +W: IF NR >UM GOTO 280
220 R = W + INT( RND(W) *(L1 -W))
230 PRINT D$"READ "NF$",R"R
240 INPUT B: INPUT F: INPUT A1$
250 IF B = TH AND F = TH GOTO 210
260 IF A1$ >A$ GOTO 210
270 IF A1$ >LA$ GOTO 272
271 GOTO 210
272 L = R:LA$ = A1$: GOTO 210
280 R = L
290 PRINT D$"READ "NF$",R"R
300 INPUT B:B = B -TH: INPUT F:F = F -TH: INPUT A1$
310 IF A1$ = A$ GOTO 5000
320 IF A1$ >A$ GOTO 540
330 R = F:PB = B: GOTO 290
350 A$ = STR$( VAL(A1$) +W)
355 IF LEN(A$) = 4 THEN RETURN
360 A$ = "0" +A$: GOTO 355
400 PB = B:B = R:R = H1: PRINT D$: HOME
410 IF AS$ = "Y" GOTO 615
540 PRINT D$: HOME
560 PRINT NZ$(W);" ";: INVERSE : PRINT A$;: NORMAL : PRINT " NOT FOUND"
565 IF FT$ = "S" GOTO 750
570 PRINT "DO YOU WANT TO ADD IT TO ";NF$;"?";: INPUT R$
580 IF R$ = "N" GOTO 755
590 IF R$ = "Y" GOTO 620
600 PRINT "REPLY Y OR N"
610 GOTO 540
615 AS$ = "N"
620 GOSUB 4000:F = R:R = L1:A1$ = A$: GOTO 5030
750 GOSUB 9450
755 IF A1$ < >"^" GOTO 757
756 R = B
757 IF R = 1 GOTO 9500
758 PRINT D$"READ "NF$",R";R
759 INPUT B:B = B -1000: INPUT F:F = F -1000: INPUT A1$:A$ = A1$
770 IF R = H1 GOTO 756
771 GOTO 5000
775 PRINT "*** MAX LENGTH IS ";LZ(1): GOTO 150
780 PRINT "*** OUT OF RANGE": GOTO 150
785 PRINT "*** MAX IS ";VZ(1): GOTO 150
790 PRINT "*** MIN IS ";LZ(1): GOTO 150
795 PRINT "*** MUST BE AN INTEGER": GOTO 150
890 PRINT D$"WRITE "NF$",R"R
900 PRINT 1000: PRINT 1000
910 PB = B
920 R = F
930 PRINT D$"READ "NF$",R"R
940 INPUT B: INPUT F
941 B = B -1000
942 F = F -1000
950 PRINT D$"WRITE "NF$",R"R
960 PRINT PB +1000: PRINT F +1000
970 PRINT D$"READ "NF$",R"PB
980 INPUT B: INPUT F
981 B = B -1000
982 F = F -1000
990 PRINT D$"WRITE "NF$",R"PB
1000 PRINT B +1000: PRINT R +1000
1010 PRINT D$
1020 HOME
1030 PRINT NZ$(W);" ";A$;" DELETED"
1035 GOSUB 9450
1040 GOTO 105
4000 FZ$(W) = A$
4010 YN$ = "N":SW = 0
4020 I = 1: GOTO 4030
4025 SW = 1
4030 I = I +1
4040 IF I >NF GOTO 4440
4050 IF RZ$(I) = YN$ GOTO 4025
4060 GOSUB 9400
4061 PRINT NZ$(I); TAB( 14);
4070 IF TZ$(I) = "N" GOTO 4330
4080 INPUT I$
4090 IF LEN(I$) >LZ(I) GOTO 4310
4100 IF LEN(I$) = 0 GOTO 4270
4110 IF VZ(I) = 0 GOTO 4260
4120 J = INT(VZ(I)/1000)
4130 K = VZ(I) -(J *1000)
4140 IF I$ = VZ$(J) GOTO 4260
4150 J = J +1
4160 IF J >K GOTO 4180
4170 GOTO 4140
4180 J = INT(VZ(I)/1000)
4190 GOSUB 9400
4200 PRINT "*** VALID VALUES ARE ***"
4210 PRINT TAB( 15);
4220 PRINT VZ$(J); TAB( 26);MZ$(J)
4230 J = J +1: IF J >K GOTO 4060
4240 GOTO 4210
4260 FZ$(I) = I$: GOTO 4030
4270 IF DZ(I) >1000 GOTO 4300
4280 J = DZ(I)
4285 FZ$(I) = SZ$(J): GOTO 4030
4300 J = DZ(I) -1000
4305 FZ$(I) = DZ$(J): GOTO 4030
4310 PRINT "*** MAX LENGTH IS ";LZ(I): GOTO 4060
4330 INPUT J
4390 IF J <LZ(I) GOTO 4430
4400 IF J >VZ(I) GOTO 4420
4410 FZ$(I) = STR$(J): GOTO 4030
4420 PRINT "*** MAX IS"; TAB( 15);VZ(I): GOTO 4060
4430 PRINT "*** MIN IS"; TAB( 15);LZ(I): GOTO 4060
4440 IF YN$ = "Y" GOTO 4640
4445 IF SW = 0 GOTO 4640
4450 GOSUB 9400
4460 PRINT "*** THAT'S ALL THE REQUIRED DATA ***"
4470 INPUT "*** WANT THE REST TO DEFAULT?";R$
4480 IF R$ = "Y" GOTO 4520
4490 IF R$ = "N" GOTO 4510
4500 PRINT "*** REPLY Y OR N": GOTO 4470
4510 YN$ = "Y": GOTO 4020
4520 I = 1
4530 I = I +1
4540 IF I >NF GOTO 4640
4550 IF RZ$(I) = "Y" GOTO 4530
4560 IF TZ$(I) = "N" GOTO 4620
4580 J = DZ(I)
4590 FZ$(I) = SZ$(J): GOTO 4530
4600 J = DZ(I) -1000
4610 FZ$(I) = DZ$(J): GOTO 4530
4620 J = DZ(I)
4630 FZ$(I) = STR$(J): GOTO 4530
4640 L1 = L1 +1
4650 PRINT D$"WRITE "NF$",R"L1
4660 PRINT B +1000: PRINT R +1000: PRINT A$
4670 I = 1
4680 I = I +1
4690 IF I >NF GOTO 4710
4700 PRINT FZ$(I): GOTO 4680
4710 PRINT D$"WRITE "NF$",R"R
4720 PRINT L1 +1000
4730 PRINT D$"WRITE "NF$",R"B
4740 PRINT PB +1000: PRINT L1 +1000
4750 PRINT D$"WRITE "NF$",R0"
4760 PRINT H1 +1000: PRINT L1 +1000
4790 RETURN
5000 FZ$(W) = A$:I = W
5010 I = I +1: IF I >NF GOTO 5030
5020 INPUT FZ$(I): GOTO 5010
5030 PRINT D$:I = 1: GOTO 5310
5050 I = I +1:J = J +1: IF I >NF GOTO 5320
5060 IF J >9 GOTO 5320
5070 PRINT J;" ";NZ$(I); TAB( 16);
5080 IF TZ$(I) = "N" GOTO 5100
5090 IF LEN(FZ$(I)) >24 GOTO 5180
5100 INVERSE : PRINT FZ$(I);: NORMAL : IF TZ$(I) = "C" GOTO 5130
5110 PRINT
5120 GOSUB 9400: GOTO 5050
5130 IF VZ(I) = O GOTO 5110
5140 X = INT(VZ(I)/1000):Y = VZ(I) -(X *1000)
5150 IF FZ$(I) = VZ$(X) GOTO 5170
5160 X = X +1: IF X >Y GOTO 5110
5165 GOTO 5150
5170 PRINT TAB( 24);: INVERSE : PRINT MZ$(X): NORMAL : GOTO 5120
5180 Y = LEN(FZ$(I)) -24:X$ = LEFT$(FZ$(I),24)
5190 Y$ = RIGHT$(FZ$(I),Y): INVERSE : PRINT X$: NORMAL
5200 PRINT "---------------------------------";: INVERSE : PRINT Y$: NORMAL
5210 GOTO 5050
5250 IF R$ = "D" GOTO 5900
5260 IF R$ >"0" GOTO 5300
5275 GOTO 5670
5300 IF R$ <":" GOTO 5400
5305 GOTO 5670
5310 HOME : PRINT TAB( 13);W + INT((I -W)/9);" OF "; INT((NF +7)/9);" ";NF$
5311 B$ = LEFT$(FZ$(W),23)
5312 PRINT " ";NZ$(W); TAB( 16);: INVERSE : PRINT B$: NORMAL
5314 J = 0: GOSUB 9400: GOTO 5050
5320 IF R1$ = "C" GOTO 5720
5330 PRINT " S=SEARCH FOR NEW ";NZ$(W)
5331 PRINT "1-9=CHANGE DATA A=ADD Q=QUIT"
5335 PRINT " M=MORE N=NXT P=PRV C=CPY D=DEL ";: INPUT R$
5338 IF R$ = "Q" GOTO 9500
5340 IF R$ = "M" GOTO 5720
5350 IF R$ = "N" GOTO 5750
5360 IF R$ = "P" GOTO 5800
5370 IF R$ = "S" GOTO 105
5380 IF R$ = "C" GOTO 5850
5385 IF R$ = "A" GOTO 5880
5390 GOTO 5250
5400 G = VAL(R$): IF G >J -1 GOTO 5700
5401 IF G < > INT(G) GOTO 5712
5403 G = G +1 +(9 * INT((I -3)/9))
5405 GOSUB 9400
5410 PRINT " ";NZ$(G); TAB( 15);
5420 IF TZ$(G) = "N" GOTO 5620
5430 INPUT I$
5440 IF LEN(I$) >LZ(G) GOTO 5610
5450 IF VZ(G) = 0 GOTO 5540
5460 J = INT(VZ(G)/1000):K = VZ(G) -(J *1000)
5470 IF I$ = VZ$(J) GOTO 5540
5480 J = J +1: IF J >K GOTO 5490
5485 GOTO 5470
5490 J = INT(VZ(G)/1000): GOSUB 9400
5500 PRINT "*** VALID VALUES ARE ***"
5510 PRINT TAB( 16);VZ$(J); TAB( 24);MZ$(J)
5520 J = J +1: IF J >K GOTO 5530
5525 GOTO 5510
5530 GOSUB 9400: GOTO 5410
5540 FZ$(G) = I$
5560 PRINT D$"WRITE "NF$",R"R
5570 PRINT B +1000: PRINT F +1000: PRINT A$:Q1 = 1
5580 Q1 = Q1 +1: IF Q1 >NF GOTO 5600
5590 PRINT FZ$(Q1): GOTO 5580
5600 PRINT D$
5602 IF I <3 GOTO 5030
5605 I = 1 +(9 * INT((I -3)/9)): GOTO 5310
5610 PRINT "***MAX LENGTH IS ";LZ(G): GOTO 5530
5620 INPUT J: IF J <LZ(G) GOTO 5660
5630 IF J >VZ(G) GOTO 5650
5640 FZ$(G) = STR$(J): GOTO 5560
5650 PRINT "***MAX IS ";VZ(G): GOTO 5530
5660 PRINT "*** MIN IS ";LZ(G): GOTO 5530
5670 HOME : PRINT "*** BAD RESPONSE, ENTER AGAIN ***"
5680 GOSUB 9450: GOTO 5600
5700 HOME : PRINT "*** MAX CHANGE NBR ON THIS SCREEN IS ";J -1
5710 GOSUB 9450: GOTO 5600
5712 HOME : PRINT "*** MUST BE WHOLE NUMBER": GOSUB 9450: GOTO 5600
5720 IF I < = NF GOTO 5740
5725 IF R1$ < >"C" GOTO 5030
5730 PRINT D$"PR#0"
5735 R1$ = "B": GOTO 5030
5740 I = I -1: GOTO 5310
5750 IF F = H1 GOTO 5790
5760 R = F
5765 PRINT D$"READ "NF$",R"R
5770 INPUT B: INPUT F: INPUT A1$:A$ = A1$
5780 B = B -1000:F = F -1000: GOTO 5000
5790 HOME : PRINT "*** THAT WAS LAST RECORD ON FILE"
5795 GOSUB 9450: GOTO 5600
5800 IF B = 1 GOTO 5830
5810 R = B: GOTO 5765
5830 HOME : PRINT "*** THAT WAS FIRST RECORD ON FILE"
5840 GOSUB 9450: GOTO 5600
5850 HOME : INPUT "*** TURN ON PRINTER & HIT RETURN";R$
5860 PRINT D$"PR#1"
5870 R1$ = "C": PRINT : GOTO 5030
5880 IF FT$ < >"S" GOTO 105
5885 GOTO 170
5900 GOSUB 9400: PRINT "SURE YOU WANT TO DELETE THIS ONE";
5910 INPUT R$
5920 IF R$ = "Y" GOTO 890
5930 GOTO 5600
7000 ONERR GOTO 7700
7010 HOME
7012 PRINT "FILE MAINTENANCE": GOSUB 9400
7020 PRINT "ENTER FILE NAME";
7030 INPUT NF$
7040 PRINT D$"OPEN SCMA-"NF$",L60"
7050 PRINT D$"READ SCMA-"NF$",R0"
7060 INPUT FP: INPUT FT$: INPUT NF$: INPUT RL: INPUT LR
7070 FP = FP -100
7075 INPUT NF: INPUT NV: INPUT ND: INPUT NS
7076 DIM NZ$(NF),TZ$(NF),RZ$(NF),LZ(NF),VZ(NF),DZ(NF),FZ$(NF)
7078 DIM MZ$(NV),VZ$(NV),DZ$(ND),SZ$(NS)
7079 NF = 0:NV = 0:ND = 0:NS = 0
7080 POKE 216,0
7090 PRINT D$
7091 PRINT "LOADING SCMA-";NF$: PRINT
7092 PRINT D$"READ SCMA-"NF$",R"FP
7100 INPUT FP: INPUT TY$:FP = FP -100
7120 IF TY$ = "N" GOTO 7500
7130 IF TY$ = "C" GOTO 7190
7140 IF TY$ = "V" GOTO 7350
7145 PRINT D$"CLOSE SCMA-"NF$
7150 GOTO 15
7190 INPUT VP: INPUT DN$: INPUT RQ$: INPUT ML: INPUT DV$
7200 NF = NF +1
7210 NZ$(NF) = DN$
7220 TZ$(NF) = TY$
7230 RZ$(NF) = RQ$
7240 LZ(NF) = ML
7260 IF LEN(DV$) <6 GOTO 7300
7270 ND = ND +1
7280 DZ$(ND) = DV$
7285 DZ(NF) = ND +1000
7290 GOTO 7330
7300 NS = NS +1
7310 SZ$(NS) = DV$
7320 DZ(NF) = NS
7330 IF VP = 0 GOTO 7090
7340 CR = FP:FP = VP
7345 VZ(NF) = (NV +1) *1000
7348 GOTO 7090
7350 INPUT MV$: INPUT VV$
7360 NV = NV +1
7370 VZ$(NV) = VV$
7380 MZ$(NV) = MV$
7400 IF FP < >0 GOTO 7090
7410 FP = CR
7420 VZ(NF) = VZ(NF) +NV
7430 GOTO 7090
7500 INPUT DN$: INPUT RQ$: INPUT MN: INPUT MX: INPUT DV
7510 NF = NF +1
7520 NZ$(NF) = DN$
7530 TZ$(NF) = TY$
7540 RZ$(NF) = RQ$
7550 LZ(NF) = MN
7560 VZ(NF) = MX
7570 DZ(NF) = DV
7580 GOTO 7090
7700 PRINT D$
7710 POKE 216,0
7720 HOME
7730 PRINT "SCMA-";NF$;" NOT FOUND"
7740 PRINT "SCMA-";NF$;" IS REQUIRED"
7750 PRINT D$"DELETE SCMA-"NF$
7760 GOTO 9999
9000 PRINT D$
9005 POKE 216,0
9010 HOME
9020 INVERSE : PRINT NF$;: NORMAL : PRINT " NOT MOUNTED"
9030 PRINT "DO YOU WANT TO CREATE A NEW ";: INVERSE : PRINT NF$;: NORMAL : INPUT R$
9050 IF R$ = "N" GOTO 9090
9060 IF R$ = "Y" GOTO 9130
9070 PRINT "REPLY Y OR N"
9080 GOTO 9010
9090 HOME
9100 PRINT "MOUNT DISKETTE WITH ";NF$;" AND RERUN"
9110 PRINT D$"DELETE "NF$
9120 GOTO 9999
9130 BD$ = "NEVER":CD$ = " "
9174 PRINT D$"DELETE "NF$
9176 PRINT D$"OPEN "NF$",L"RL
9178 PRINT D$"WRITE "NF$",R0"
9180 PRINT 1002: PRINT 1002: PRINT CD$: PRINT BD$: PRINT FT$
9190 PRINT D$"WRITE "NF$",R1"
9200 PRINT 1000: PRINT 1002: PRINT "0"
9210 PRINT D$"WRITE "NF$",R2"
9220 PRINT 1001: PRINT 1000: PRINT "^"
9230 PRINT D$
9240 GOTO 30
9400 PRINT "---------------------------------------": RETURN
9450 Q3 = 0
9460 Q3 = Q3 +1: IF Q3 >50 GOTO 9480
9470 GOTO 9460
9480 RETURN
9500 PRINT D$"CLOSE "NF$
9999 PRINT D$"RUN JELLO"